package com.i8office.android.zhihuixinwu.widget;

import android.content.Context;
import android.support.v4.view.ActionProvider;
import android.view.LayoutInflater;
import android.view.View;

import com.i8office.android.zhihuixinwu.R;

/**
 * Created by pc on 2018/7/12.
 */

public class AddActionProvider extends ActionProvider {
    private Context mContext;
    private View.OnClickListener onAddClickListener;

    public AddActionProvider(Context context) {
        super(context);
        mContext = context;
    }

    @Override
    public View onCreateActionView() {
        View view = LayoutInflater.from(mContext).inflate(R.layout.menu_add, null);
        view.findViewById(R.id.add).setOnClickListener(onAddClickListener);
        return view;
    }

    public void setOnAddClickListener(View.OnClickListener onAddClickListener) {
        this.onAddClickListener = onAddClickListener;
    }
}
